//
//  SearchDisControl.m
//  WE
//
//  Created by iMacOne on 15/12/3.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "SearchDisControl.h"
#import "Size.h"
#import "ToolUtil.h"
#import <Masonry.h>
@interface SearchDisControl ()
@property(nonatomic, strong)UISearchBar * searchBar;
@end

@implementation SearchDisControl

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"搜索疾病";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self creatSearchBar];
}
- (void)creatSearchBar
{
    self.searchBar = [UISearchBar new];
    _searchBar.placeholder = @"search";
    _searchBar.delegate = self;
//    _searchBar.selectedScopeButtonIndex = 5;
//    _searchBar.barStyle = UISearchBarStyle;
//    [[[[_searchBar.subviews objectAtIndex:0] subviews] objectAtIndex:0] removeFromSuperview];
//    
//    [_searchBar setBackgroundColor:[UIColor clearColor]];
//    [_searchBar.subviews[0] removeFromSuperview];
//    _searchBar.backgroundColor = [UIColor clearColor];
//    _searchBar.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:_searchBar];
    [_searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.top.equalTo(self.view).offset(64);
        make.width.offset(WindowWidth);
        make.height.offset(50);
        
    }];

}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
    
//    searchBar.text;
    [searchBar resignFirstResponder];
    
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.searchBar resignFirstResponder];
}

@end
